package org.apache.dubbo;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.extension.ExtensionLoader;
import org.apache.dubbo.rpc.Protocol;

public class SpiTest {

    public static void main(String[] args) {

//        ExtensionLoader<Protocol> loader = ExtensionLoader.getExtensionLoader(Protocol.class);
//        Protocol http = loader.getExtension("http");
//        System.out.println(http);


        //aop
        ExtensionLoader<Car> loader = ExtensionLoader.getExtensionLoader(Car.class);
        Car red = loader.getExtension("true");
        System.out.println(red.getCar(null));

        //依赖注入
//        ExtensionLoader<Person> loader = ExtensionLoader.getExtensionLoader(Person.class);
//        Person black = loader.getExtension("black");
//        URL url = new URL("xx","localhost",8080);
//        url=url.addParameter("car","black");
//        //System.out.println(black.getCar().getCar(url));
//        black.getCar().test();

    }
}
